from apps.a_common.constants import ProcessStatus
from apps.a_common.db import TimeMarkModel
from apps.foundation import db
from utils.time import int_timestamp


class Process(TimeMarkModel):
    name = db.Column(db.VARCHAR(126), index=True, nullable=False)
    start_at = db.Column(db.Integer, default=int_timestamp)
    end_at = db.Column(db.Integer, nullable=True)
    status = db.Column(db.SMALLINT, default=ProcessStatus.SURVEY)
    project_id = db.Column(db.Integer, nullable=False)
